<template>
  <com-card>
    <div slot="com_content">
      <el-table border :data="formObj">
        <el-table-column type="index" label="序号"></el-table-column>
        <el-table-column prop="authName" label="权限名称"></el-table-column>
        <el-table-column prop="path" label="路径"></el-table-column>
        <el-table-column prop="level" label="权限级别">
          <template #default="{ row }">
            <el-tag v-show="row.level == 0">一级</el-tag>
            <el-tag type="warning" v-show="row.level == 1">二级</el-tag>
            <el-tag type="success" v-show="row.level == 2">三级</el-tag>
          </template>
        </el-table-column>
      </el-table>

    </div>
  </com-card>
</template>

<script>
import ComCard from "../../components/comCard";
import { api_query } from "../../api/quanxian.js";
export default {
  components: {
    ComCard,
  },
  data() {
    return {
      formObj: [],
      
    };
  },
  mounted() {
    this.query();
  },
  methods: {
  

    async query() {
      let rst = await api_query({ url: "list" });
      if (rst.meta.status == 200) {
        // 将rst.data里边的值赋值给formObj
        this.formObj = rst.data;
      }
      console.log(rst);
    },
  },
};
</script>

<style lang="less" scoped>
</style>